// 中心线槽口
// 草图 - 裁剪
import { BaseCommand } from '@amcax/base';

import { useEffect, useRef } from 'react';
import { CmdInteractor } from './CmdInteractor';

interface FilletDialogProps {
  title: string;
  onClose: () => void;
}
function FilletCommand({ onClose }: FilletDialogProps) {
  const cmdRef = useRef<CmdInteractor>(null);
  useEffect(() => {
    cmdRef.current = new CmdInteractor();
    cmdRef.current.addExit(onClose);
    return () => {
      cmdRef.current && cmdRef.current.destroy();
      cmdRef.current = null;
    };
  }, []);
  return <></>;
}

export const cmdFillet: BaseCommand = {
  id: 'CmdFillet',
  label: 'command.fillet',
  icon: 'commands/sketch/fillet',
  group: 'sketch',
  create: (label: string, onClose: () => void) => (
    <FilletCommand
      title=''
      onClose={onClose}
    />
  ),
};
